package cn.maihe.elg.operation.common.annotation;

import cn.maihe.elg.operation.common.validator.DateFmtValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * @Description
 * @Author WJH
 * @Date 2021/07/13
 */
@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE})
@Retention(RUNTIME)
@Documented
@Constraint(validatedBy = {DateFmtValidator.class})
public @interface DateFmt {

    /**
     * @return 日期格式
     */
    String value() default "yyyy-MM-dd HH:mm:ss";

    /**
     * @return the error message template
     */
    String message() default "日期格式化失败";


    Class<?>[] groups() default { };

    Class<? extends Payload>[] payload() default { };

}
